package com.homework2;

import java.util.ArrayList;
import java.util.Collections;
import java.util.HashSet;

public class Test09 {
    public static void main(String[] args) {
        ArrayList<String> arr1 = new ArrayList<>();
        arr1.add("a");
        arr1.add("b");
        arr1.add("c");
        arr1.add("d");
        arr1.add("e");
        arr1.add("f");
        ArrayList<String> arr2 = new ArrayList<>();
        arr2.add("a");
        arr2.add("g");
        arr2.add("f");
        arr2.add("c");
        arr2.add("j");
        arr2.add("l");
        HashSet<String> hashSet = new HashSet<>();
        for (String s : arr1) {
            hashSet.add(s);
        }
        for (String s : arr2) {
           hashSet.add(s);
        }
        for (String s : hashSet) {
            System.out.print(s);
        }
    }
}
